/*
 * @Author: upp24 1246815351@qq.com
 * @Date: 2023-06-27 11:42:36
 * @LastEditors: upp24 1246815351@qq.com
 * @LastEditTime: 2023-06-27 17:31:56
 * @FilePath: /pure-admin-thin-i18n/src/api/goods.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";
export type BannerResult = {
  page: number;
  pagesize: number;
  success: boolean;
  code: number;
  token: string;
  msg: string;
  data: {
    data: any[];
    total: number;
    page: number;
    pagesize: number;
  };
};
/** 商品列表*/
export const goodsList = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("wares/list"), {
    data
  });
};
/** 商品修改*/
export const goodsUpdate = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("wares/update"), {
    data
  });
};
/** 商品上传*/
export const goodsUpload = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("/upload"), {
    data
  });
};
/** 商品删除*/
export const goodsDelete = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("wares/delete"), {
    data
  });
};
/**商品状态 */
export const goodsStatus = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("wares/status"), {
    data
  });
};
/**商品详情 */
export const goodsDetail = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("wares/info"), {
    data
  });
};

/**商品类型列表 */
export const goodsTypeList = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("wares/type/list"), {
    data
  });
};
/**商品类型修改 */
export const goodsTypeUpdate = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("wares/type/update"), {
    data
  });
};
/**商品类型删除 */
export const goodsTypeDelete = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("wares/type/delete"), {
    data
  });
};
/**商品类型详情 */
export const goodsTypeInfo = (data?: object) => {
  return http.request<BannerResult>("post", baseUrlApi("wares/type/info"), {
    data
  });
};
